from django.template import Library

from event.models import Schedule, Track

register = Library()

@register.inclusion_tag("event/table/tracks.html")
def list_all_tracks():
  return {'track_list': Track.objects.all()}

@register.inclusion_tag("event/table/tracks.html")
def list_tracks(event):
  return {'track_list': event.track_set.all()}

@register.inclusion_tag("event/table/schedule.html")
def list_track_sessions(track_object):
  return {'hide_event': True, 'hide_track': True, 'schedule_list': Schedule.objects.filter(track = track_object)}

